#include "Platform.h"

HINSTANCE hInstance;
HWND hWnd;
const wchar_t className[] = L"Window";

void Initialize();
LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );

int WINAPI WinMain( HINSTANCE hInstance,
					HINSTANCE,
					LPSTR pCmdLine,
					int nCmdShow )
{
	MSG msg;

	Initialize();

	ShowWindow( hWnd, nCmdShow );
	UpdateWindow( hWnd );

	while( GetMessage(&msg, NULL, 0, 0 ) )
	{
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}

	return 0;
}

void Initialize()
{
	WNDCLASS wc = { };

	wc.lpfnWndProc = WndProc;
	wc.hInstance = hInstance;
	wc.lpszClassName = className;

	RegisterClass( &wc );

	hWnd = CreateWindow( className,
						L"Gladiators",
						WS_OVERLAPPEDWINDOW,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						NULL,
						NULL,
						hInstance,
						NULL );
}

LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
	switch( msg )
	{
	case WM_CREATE:

		break;
	case WM_PAINT:

		break;
	case WM_DESTROY:
		PostQuitMessage( 0 );

		break;
	}
	return DefWindowProc( hWnd, msg, wParam, lParam );
}